package com.kangye.enterprise.controller;

import com.kangye.enterprise.entity.*;
import com.kangye.enterprise.service.PlatformService;
import com.kangye.enterprise.util.ViewJsonObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @program: enterprise
 * @description:平台统计
 * @author: 索腾龙
 * @create: 2021-06-08 10:39
 **/
@Controller
public class PlatformController {
    @Autowired
    private PlatformService platformService;
    //跳转平台统计页面
    @RequestMapping("/platform")
    public String platform(){
        return "Platform";
    }
    //平台统计查询
    @ResponseBody //将java对象转为json格式的数据
    @RequestMapping("/selPlatform")
    public ViewJsonObject<Platform> selPlatform(Platform platform){
        System.out.println("领域id:"+platform.getPlatformDomoinId());
        System.out.println("开始时间:"+platform.getCreateTime());
        return platformService.selPlatfrom(platform);
    }
    @ResponseBody
    @RequestMapping("/selStatistical")
    public ViewJsonObject<Statistical> selStatistical(Integer page, Integer limit){
        return platformService.selStatistical(page, limit);
    }
    //查询领域名字
    @ResponseBody
    @RequestMapping("/selDomoin")
    public ViewJsonObject<Domoin> selDomoin(){
        return platformService.selDomoin();
    }
    //查询政策名字
    @ResponseBody
    @RequestMapping("/selCirculars")
    public ViewJsonObject<Circular> selCirculars(){
        return platformService.selCirculars();
    }
    //查询项目名字
    @ResponseBody
    @RequestMapping("/selItemAll")
    public ViewJsonObject<Item> selItemAll(){
        return platformService.selItemAll();
    }
}